Skip to content

92969: Add "expand" button overlay to charts for full-screen mode#95249

Open
abbasifaizan70 wants to merge 16 commits into
Expensify:mainfrom
abbasifaizan70:92969
Open

92969: Add "expand" button overlay to charts for full-screen mode#95249
abbasifaizan70 wants to merge 16 commits into
Expensify:mainfrom
abbasifaizan70:92969

Conversation

@abbasifaizan70

@abbasifaizan70 abbasifaizan70 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Adds an expand button overlaid on the top-right corner of inline charts, which opens the chart in a centered full-screen modal. The modal reuses the already-parsed chart data and renders it scaled to the viewport, so the expanded chart matches the inline one exactly, just larger.

Fixed Issues

$ #92969
PROPOSAL: #92969 (comment)

Tests

  • Verify that no errors appear in the JS console
  1. Open the Concierge chat and ask for a chart, e.g. "Graph my spending by category".
  2. Verify the inline chart shows an expand button in its top-right corner.
  3. Tap the expand button.
  4. Verify a centered full-screen modal opens with the chart at full viewport width, matching the inline chart.
  5. Close the modal via the back button and verify the chat is unchanged.
  6. Narrow the window (or use the side panel) and verify the inline chart scales down without clipping.

Offline tests

same as tests.

QA Steps

same as tests.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Screen.Recording.2026-07-07.at.2.33.29.AM.mov
Android: mWeb Chrome Screenshot 2026-07-07 at 2 39 44 AM
iOS: Native
Screen.Recording.2026-07-07.at.2.36.43.AM.mov
iOS: mWeb Safari
Screen.Recording.2026-07-07.at.2.37.58.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-07-07.at.2.29.33.AM.mov

@melvin-bot

melvin-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx ts-node ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx ts-node ./scripts/generateTranslations.ts --compare-ref main

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/CONST/index.ts 94.81% <ø> (ø)
...ctoryChartContainer/VictoryChartContainerFixed.tsx 0.00% <ø> (ø)
...er/HTMLRenderers/VictoryChartRenderer/constants.ts 100.00% <100.00%> (ø)
src/hooks/useHover.ts 71.42% <ø> (ø)
src/styles/index.ts 63.40% <ø> (ø)
.../VictoryChartRenderer/BaseVictoryChartRenderer.tsx 0.00% <0.00%> (ø)
...rtRenderer/components/VictoryChartExpandButton.tsx 7.69% <7.69%> (ø)
...hartRenderer/components/VictoryChartExpandable.tsx 6.66% <6.66%> (ø)
...artRenderer/components/VictoryChartExpandModal.tsx 2.70% <2.70%> (ø)
... and 8 files with indirect coverage changes

@abbasifaizan70 abbasifaizan70 marked this pull request as ready for review July 6, 2026 14:36
@abbasifaizan70 abbasifaizan70 requested review from a team as code owners July 6, 2026 14:36
@melvin-bot

melvin-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

@situchan Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot Bot removed request for a team and joekaufmanexpensify July 6, 2026 14:37

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb9bb9f384

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@dannymcclain

Copy link
Copy Markdown
Contributor

cc @Expensify/design this button doesn't look right to me at all. Can we use one of our standard icon buttons here? (fully circle, smaller icon, etc.)

@shawnborton

Copy link
Copy Markdown
Contributor

Totally agree. Please use our standard icon buttons, use a small 28x28 icon and it should probably be like 12px from the top and 12px from the right?

@abbasifaizan70

Copy link
Copy Markdown
Contributor Author

@situchan I fixed above AI feedbacks.
@shawnborton updated the icons and attach latest video for web only. Will attached other platform video once login issue is fixed as currently facing login issues.

@dannymcclain

Copy link
Copy Markdown
Contributor

Much better. @shawnborton do you think we should only show that icon on hover? Basically exactly what we do for receipts?

CleanShot.2026-07-06.at.11.28.54.mp4

@shawnborton

Copy link
Copy Markdown
Contributor

Yup, that makes sense to me! Or we always show a three dots icon in the top right but I don't think that will look good based on how these things scale on mobile devices.

Also, does clicking anywhere on the chart also expand it? Or just this button does?

@abbasifaizan70

Copy link
Copy Markdown
Contributor Author

@luacmartins Update the button design and show on hover.

@luacmartins

Copy link
Copy Markdown
Contributor

@abbasifaizan70 is this ready for review?

@abbasifaizan70

Copy link
Copy Markdown
Contributor Author

@luacmartins yes, as per new requirements.

@luacmartins

Copy link
Copy Markdown
Contributor

@situchan could you please review?

@luacmartins

Copy link
Copy Markdown
Contributor

@situchan did you get a chance to review this yet?

@situchan

situchan commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Code review — overall the approach is clean: reusing VictoryChartContent inside the modal via the shared context, and the uniform transform-scale trick to keep labels/legend aligned is well-reasoned and clearly commented. A few things worth addressing before merge:

🔴 Background color isn't theme-resolved in the modal (dark-mode mismatch)

The inline chart resolves its background through the chart theme map before painting it: VictoryChartContainerFixed.tsx:31-32 calls resolveChartContainerBgColor(rawBgColor, theme). The modal instead applies the raw value: VictoryChartExpandModal.tsx:60:87. Since resolveChartContainerBgColor remaps productLight200 → theme.cardBG (etc.), in dark mode the inline chart gets the dark cardBG but the expanded chart keeps the light raw color — so the expanded background won't match the inline one, contradicting the PR's "keeps the same background" goal. Resolve it the same way: resolveChartContainerBgColor(backgroundColor, useTheme()) before passing to getBackgroundColorStyle.

🟡 Polar charts won't render "identical, only larger"

Inline, polar charts are clipped to POLAR_CONTAINER_HEIGHT_RATIO (0.9) to hide dead bottom space (VictoryChartContainerFixed.tsx:46). The modal scales the full designHeight with no such ratio, so an expanded pie/polar chart will carry extra bottom padding and center differently than its inline counterpart. Worth confirming a pie chart in the modal against the screenshots (the shared ones look Cartesian).

🟡 Redundant hasHoverSupport() computation

BaseVictoryChartRenderer.tsx:27-29 calls both useHover() and hasHoverSupport() — but useHover already computes hasHoverSupport() internally and gates its setters with it, so hovered is already guaranteed false on non-hover devices. The extra call/import is redundant; consider having useHover expose deviceHasHoverSupport instead of recomputing it here.

🟢 Non-blocking notes

  • The hidden expand button stays mounted at opacity0 and, being absolutely positioned, still captures pointer events in the top-right corner even when invisible. The inline comment acknowledges this as intentional/acceptable — fine, but adding pointerEvents="none" while hidden would make it strictly safe.
  • The Author Checklist ticks "I added unit tests," but I don't see any test files in the diff. If that box is checked, the tests should be included (or the box unchecked).
Things that look good
  • expand translation added across all 10 locales with correct per-locale wording.
  • Heavy VictoryChartContent in the modal is guarded by isMeasured (waits for a non-zero onLayout), so it won't do Skia work until the modal is actually laid out.
  • sentryLabel, accessibilityLabel, and Tooltip are all wired up on the button.

This is an automated review — treat findings as suggestions to verify, not blockers. Reply with @MelvinBot <feedback> to refine.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 159724af2f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Potential regressions to existing chart rendering that aren't called out in the PR's test steps or my earlier review. I can't run the app from here, so these are code-level risks to verify — ordered by likely impact.

1. Every inline chart now permanently mounts a full Modal (perf)

BaseVictoryChartRenderer.tsx:70-73 renders <VictoryChartExpandModal> unconditionally for every chart, and Modal/BaseModal is a heavy component (dozens of hooks, ModalContext.Provider, ReanimatedModal, NavigationBar, offline-indicator context…). A Concierge answer with several charts now instantiates that many hidden modals plus a useHover subscription and an extra wrapper View per chart. This is new per-chart mount/render cost on the chat path where none existed before — worth profiling a message with 3–5 charts for scroll/render regressions. (The chart content is safely gated behind isMeasured, so the concern is the modal shell, not the Skia canvas.)

2. Always-on button occludes the top-right corner of existing charts on touch devices

On touch (no hover), BaseVictoryChartRenderer.tsx:67 forces shouldShow true, so the button is always painted over the chart's top-right corner (pAbsolute t0 r0 m3). Every existing Concierge chart on mobile/mWeb now has a button sitting on top of whatever renders there (legend, a tall bar, an axis label). The PR's steps only test tapping expand, not whether the button covers chart content. Verify against a chart whose legend/data reaches the top-right on a narrow viewport.

3. Hover re-renders the chart root on web

:28 puts hovered state at the chart root, so every mouseenter/mouseleave re-renders BaseVictoryChartRenderer. This is only cheap if React Compiler memoizes the VictoryChartContainer/VictoryChartContent subtree so it doesn't re-render on hover — please confirm this file passes react-compiler-compliance-check (a bailout here means the Skia chart re-renders on every hover).

Non-regression I checked

The charts have no press/gesture/tooltip handlers (grep is clean), so the button swallowing pointer events in that corner blocks nothing interactive — the author's inline comment is correct. Existing chart tests are parser/util-only, so the structural wrapper change won't break them.


Automated review — treat as risks to verify, not confirmed bugs. Reply @MelvinBot <feedback> to refine.

@situchan

situchan commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Please check ^

@abbasifaizan70

abbasifaizan70 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@situchan Addressed all points:

  1. Modal background is now resolved via resolveChartContainerBgColor with the current theme, matching inline rendering in dark mode.
  2. Polar charts are clipped to POLAR_CONTAINER_HEIGHT_RATIO in the modal the same way the inline container does (ratio moved to shared constants).
  3. useHover now exposes deviceHasHoverSupport — redundant call removed.
  4. Hidden expand button now sets pointerEvents="none".
  5. The modal only mounts after first expand and unmounts after the close animation, so charts no longer carry a hidden Modal each.
  6. Hover/expand state moved into a VictoryChartExpandable wrapper that takes the chart as stable children, so hovering never re-renders the chart subtree.
  7. On the touch-device button placement: always-visible matches the receipt-actions pattern design requested; charts render nothing interactive in that corner today.

@shawnborton

Copy link
Copy Markdown
Contributor

Let us know when there are new screenshots/videos to review.

@situchan

situchan commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Let us know when there are new screenshots/videos to review.

video.mov

@shawnborton

Copy link
Copy Markdown
Contributor

Can you expand the chart by simply tapping on it? That might be nice for mobile. When the chart is expanded in the attachment modal, can you zoom in? Again, that might be nice for mobile.

@situchan

situchan commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Can you expand the chart by simply tapping on it? That might be nice for mobile. When the chart is expanded in the attachment modal, can you zoom in? Again, that might be nice for mobile.

Zoom feature not implemented yet.
Can we do that in follow-up PR? To keep PRs smaller.

@luacmartins

Copy link
Copy Markdown
Contributor

Sure, let's do that in a separate PR.

@situchan

Copy link
Copy Markdown
Contributor

@abbasifaizan70 please merge main

@MelvinBot

Copy link
Copy Markdown
Contributor

⚠️ Something went wrong. This may be a transient issue — try again. If it persists, check status.anthropic.com.

Run details

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5d81dfb060

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@abbasifaizan70

Copy link
Copy Markdown
Contributor Author

@situchan Updated with latest main and fixed CI/CD as well.

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Re-reviewed at aa02f48. The refactor addressed the earlier rounds cleanly — hover/expand state now lives in VictoryChartExpandable with the chart passed as stable children (no chart re-render on hover), the modal is lazily mounted/unmounted, the background is theme-resolved, polar clipping is shared, and the UI-3 inline-style flags are gone. A few small items remain worth a look before merge:

🟡 Fluid charts lose their container background/rounding when expanded

For a chart without numeric design dimensions, the inline path still routes through VictoryChartContainerFixed, which applies {backgroundColor, borderRadius, overflow} to the content (VictoryChartContainerFixed.tsx:48). The modal's fluid fallback renders VictoryChartContent in a bare View with none of that styling (VictoryChartExpandModal.tsx:118-123), so such a chart expands onto the modal background and loses its rounded/themed container. This is the still-open half of the earlier codex flag (the numeric path was fixed). If Concierge charts always emit numeric width/height this branch is effectively dead — worth confirming, and if so a comment saying so; otherwise apply the same background/borderRadius here too.

🟢 Scale is measured against the padded box, so ph5 may not be fully respected

onLayout measures the container that carries styles.ph5, and layout width includes that padding (VictoryChartExpandModal.tsx:89-91), but scale divides by that full width (:68). When width is the binding dimension, the scaled chart ends up ~40px wider than the content area and eats into (or past) the intended side padding. Measuring an inner unpadded view — or subtracting the horizontal padding before computing scale — keeps the gutter. Minor/visual only.

🟢 Modal header copy

The header title is common.details → "Details" (:85), which reads a bit generic for an expanded chart. Not blocking — flagging in case the design/copy owner wants something chart-specific.

🟢 Unit-test checklist item

The Author Checklist still ticks "I added unit tests," but the diff only updates the existing useHover mock in BaseListItemTest.tsx — no tests for the new VictoryChartExpandable/VictoryChartExpandModal logic (e.g. the polar-clip scale math). Either add coverage or uncheck the box so the reviewer checklist stays accurate.

Verified as resolved from prior rounds
  • Background theme-resolved in the modal via resolveChartContainerBgColor(..., theme) — matches inline in dark mode.
  • Polar charts clipped to POLAR_CONTAINER_HEIGHT_RATIO (now a shared constant) in both paths.
  • useHover exposes deviceHasHoverSupport; redundant hasHoverSupport() call removed.
  • Hidden expand button sets pointerEvents="none".
  • Modal is only mounted after the first expand and unmounted after the close animation (shouldRenderModal), so inline charts no longer each carry a hidden modal.
  • Hover state moved out of BaseVictoryChartRenderer into VictoryChartExpandable; the chart subtree has stable element identity and won't re-render on hover.
  • Inline-style (UI-3) flags addressed via StyleUtils.getWidthAndHeightStyle / styles.overflowHidden / styles.chartExpandedContent / getTransformScaleStyle.

This is an automated review — treat findings as suggestions to verify, not blockers. Reply with @MelvinBot <feedback> to refine.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa02f48baa

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +49 to +52
<VictoryChartExpandButton
onPress={openModal}
shouldShow={hovered || !deviceHasHoverSupport}
/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the expand action visible on touch-capable hover devices

On web devices that support both touch and a fine hover pointer (for example, an iPad with a trackpad or a touchscreen laptop), hasHoverSupport() is true, so this hides the button until a mouse hover occurs. A user interacting by touch cannot trigger that hover state and therefore has no way to open the expanded chart. Use touch capability in the visibility condition instead of treating hover support as mutually exclusive with touch.

Useful? React with 👍 / 👎.

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Regression scan at aa02f48. No regressions to existing chart rendering found — the only code paths this PR adds to the existing inline flow are a wrapper View + the overlay button and an additive useHover field; the chart-sizing logic itself is untouched. One layout risk is worth verifying on native before merge, and one is an intentional-but-visible change.

🟡 Verify: expand-button placement on wide native surfaces (tablet/iPad)

The button is absolutely positioned (t0 r0) against VictoryChartExpandable's wrapper, which is only styles.mw100 (VictoryChartExpandable.tsx:42-52). On native (Yoga), a View with only maxWidth:100% and no explicit width stretches to the parent's full cross-axis width by default — so where the chart is narrower than the message column, the button can drift to the far-right of the message row instead of sitting on the chart's corner. This is the codex-bot anchoring concern, but the author's counter-check was web-only (1440px), and web flexbox shrinks the wrapper to its content — native does not. The native container even notes this divergence: "Yoga inflates the container width to match the fixed-width chart child" (index.native.tsx:14-15). On phones the chart nearly fills the column so it looks correct; the gap is wide/tablet native. Please confirm the button stays on the chart's corner on iPad / a wide Android device (or anchor the button to the rendered chart box rather than the mw100 wrapper).

🟢 Intentional but note: button now overlays the top-right of every existing chart on touch

shouldShow = hovered || !deviceHasHoverSupport (:51), so on touch/mWeb the button is always painted at the corner of every existing Concierge chart. This is the approved receipt-actions pattern, but it's a visible change to all pre-existing charts — worth a QA pass that it doesn't occlude a legend/label/tall bar reaching the top-right at narrow widths.

Cleared as NOT regressions (with evidence)
  • React Compiler: ran react-compiler-compliance-check on all changed components — VictoryChartExpandable, VictoryChartExpandModal, VictoryChartExpandButton, BaseVictoryChartRenderer, useHover all ✅ COMPILED. So the new hover state is auto-memoized and, with the chart passed as stable children, the earlier "hover re-renders the Skia chart" concern is provably resolved.
  • Existing chart tests: all chart tests are parser/util-only (VictoryChartParsers, computeChartScale, resolveVictoryChartType, etc.) — none render BaseVictoryChartRenderer, so the structural wrapper change can't break them.
  • useHover change is additive: the 6 other consumers (BaseListItem, MoneyRequestReceiptView, AnchorRenderer, CardRow, ParentNavigationSubtitle, ReceiptCell) only read hovered/bind; adding deviceHasHoverSupport doesn't affect them. The only test that mocks useHover (BaseListItemTest) was updated.
  • Chart sizing logic unchanged: VictoryChartContainerFixed and the native container are behaviorally identical — POLAR_CONTAINER_HEIGHT_RATIO was only relocated to a shared constant. The extra mw100 wrapper doesn't resize the chart because the native container fixes its own width (alignSelf: 'flex-start') and the button is absolutely positioned (out of flow).

This is an automated regression scan — treat findings as risks to verify, not confirmed bugs. Reply with @MelvinBot <feedback> to refine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants